using System.Collections;
using DG.Tweening;
using UnityEngine;
using UnityEngine.UI;

public class UI_InGame_得胜 : MonoBehaviour
{
	public CanvasGroup _CG;

	public Text _Text_Name;

	public Text _Text_用时;

	private void Start()
	{
		_CG.alpha = 0f;
		_CG.blocksRaycasts = false;
	}

	public void F_显示得胜(string name)
	{
		_Text_Name.text = name;
		bool flag = name == "金池长老";
		if (flag)
		{
			_Text_用时.gameObject.SetActive(value: true);
			float gameTime = MonoSingleton<GameManager>.Instance._GameTime;
			float num = (int)(gameTime / 60f);
			_Text_用时.text = string.Format("用时:{0}分{1}秒", num, (gameTime - num * 60f).ToString("00.00"));
		}
		else
		{
			_Text_用时.gameObject.SetActive(value: false);
		}
		StartCoroutine(Cor_显示得胜(flag));
	}

	private IEnumerator Cor_显示得胜(bool 需要暂停游戏)
	{
		GameManager._CanPlay = false;
		_CG.blocksRaycasts = true;
		Time.timeScale = 0.1f;
		_CG.DOFade(1f, 0.25f).SetUpdate(isIndependentUpdate: true);
		yield return new WaitForSecondsRealtime(2f);
		if (需要暂停游戏)
		{
			Time.timeScale = 0f;
			while (!Input.GetMouseButtonDown(0))
			{
				yield return null;
			}
			GameManager._CanPlay = true;
			Time.timeScale = 1f;
			_CG.DOFade(0f, 0.25f).SetUpdate(isIndependentUpdate: true);
			_CG.blocksRaycasts = false;
		}
		else
		{
			GameManager._CanPlay = true;
			Time.timeScale = 1f;
			_CG.DOFade(0f, 0.25f).SetUpdate(isIndependentUpdate: true);
			_CG.blocksRaycasts = false;
		}
	}
}
